package cn.zc.student.feign;

import cn.zc.student.entity.Dto.StudentExercisesResultDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.NotNull;

//@Component
@FeignClient(name = "student-server",contextId ="FeignStudentExercisesResult" )
public interface FeignStudentExercisesResult {
    /**
     * 调用远程接口查询练习分数
     */
    @GetMapping("/student/find/StudentExercisesResultResult")
    StudentExercisesResultDto findStudentExercisesResult(@NotNull @RequestParam("menuId") String menuId,@NotNull @RequestParam("studentId") String studentId);


    /**
     * 调用远程接口创建学生练习题成绩
     * @param menuId
     * @param studentId
     * @param score
     * @return
     */
    @PostMapping("/student/create/StudentExercisesResultResult")
    boolean createStudentExercisesResult(@NotNull @RequestParam("menuId")String menuId,@NotNull @RequestParam("studentId") String studentId,@NotNull @RequestParam("score") String score);
}
